package com.uep.service.impl;

import com.uep.dao.ActivityInformationMapper;
import com.uep.entity.ActivityInformation;
import com.uep.service.ActivityInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by XQ on 2017/2/7.
 */
@Service("ActivityInformation")
public class ActivityInformationServiceImpl implements ActivityInformationService {
    @Autowired
    ActivityInformationMapper activityInformationMapper;


    @Override
    public ActivityInformation findByUserId(Integer activityNumber) {
        return activityInformationMapper.selectByPrimaryKey(activityNumber);
    }

    @Override
    public List<ActivityInformation> findNameTimeAddress() {
        return activityInformationMapper.selectNameTimeAddress();
    }

    @Override
    public ActivityInformation findEventDetails(String activityName) {
        return activityInformationMapper.selectEventDetails(activityName);
    }

    @Override
    public List<ActivityInformation> findActivityType(String activityType) {
        return activityInformationMapper.selectActivityType(activityType);
    }

    @Override
    public List<ActivityInformation> findPersonActivity(String userAccount) {
        return activityInformationMapper.selectPersonActivityByUserAccount(userAccount);
    }

    @Override
    public int insertOneActivity(ActivityInformation activityInformation) {
        return activityInformationMapper.insert(activityInformation);
    }

    @Override
    public List<ActivityInformation> findSchoolActivity(String schoolName) {
        return activityInformationMapper.selectSchoolActivityBySchoolName(schoolName);
    }

    @Override
    public ActivityInformation findHotActivityByActivityStateAttendance(String activityType) {
        return activityInformationMapper.selectHotActivityByActivityStateAttendance(activityType);
    }

    @Override
    public ActivityInformation findAttendance(String activityName) {
        return activityInformationMapper.selectAttendance(activityName);
    }

    @Override
    public int updateActivityAttendance(ActivityInformation activityInformation) {
        return activityInformationMapper.updateAttendance(activityInformation);
    }


}
